package com.yc.util;

import cn.hutool.setting.dialect.Props;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;

/**
 * <p>
 * 数据源
 * <p>
 *
 * @author BAO
 * @since 2020/12/17 16:51
 */
public class DataSourceUtil {
    /**
     * 初始化数据源配置
     *
     * @return
     */
    public static DataSourceConfig getDataSourceConfig() {
        Props props = new Props("generator.properties");
        return new DataSourceConfig.Builder(props.getStr("jdbc.url"), props.getStr("jdbc.username"), props.getStr("jdbc.password"))
                .build();
    }
}
